<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>哈密瓜</title>
    <!-- <base href="../../../Public/"/> -->
    <link href="__PUBLIC__/css/css.css" type="text/css" rel="stylesheet" />
    <link href="__PUBLIC__/css/main.css" type="text/css" rel="stylesheet" />
    <link rel="shortcut icon" href="__PUBLIC__/images/main/favicon.ico" />
    <style>
        body{overflow-x:hidden; background:#f2f0f5; padding:15px 0px 10px 5px;}
        #searchmain{ font-size:12px;}
        #search{ font-size:12px; background:#548fc9; margin:10px 10px 0 0; display:inline; width:100%; color:#FFF; float:left}
        #search form span{height:40px; line-height:40px; padding:0 0px 0 10px; float:left;}
        #search form input.text-word{height:24px; line-height:24px; width:180px; margin:8px 0 6px 0; padding:0 0px 0 10px; float:left; border:1px solid #FFF;}
        #search form input.text-but{height:24px; line-height:24px; width:55px; background:url(images/main/list_input.jpg) no-repeat left top; border:none; cursor:pointer; font-family:"Microsoft YaHei","Tahoma","Arial",'宋体'; color:#666; float:left; margin:8px 0 0 6px; display:inline;}
        #search a.add{ background:url(images/main/add.jpg) no-repeat -3px 7px #548fc9; padding:0 10px 0 26px; height:40px; line-height:40px; font-size:14px; font-weight:bold; color:#FFF; float:right}
        #search a:hover.add{ text-decoration:underline; color:#d2e9ff;}
        #main-tab{ border:1px solid #eaeaea; background:#FFF; font-size:12px;}
        #main-tab th{ font-size:12px; background:url(images/main/list_bg.jpg) repeat-x; height:32px; line-height:32px;}
        #main-tab td{ font-size:12px; line-height:40px;}
        #main-tab td a{ font-size:12px; color:#548fc9;}
        #main-tab td a:hover{color:#565656; text-decoration:underline;}
        .bordertop{ border-top:1px solid #ebebeb}
        .borderright{ border-right:1px solid #ebebeb}
        .borderbottom{ border-bottom:1px solid #ebebeb}
        .borderleft{ border-left:1px solid #ebebeb}
        .gray{ color:#dbdbdb;}
        td.fenye{ padding:10px 0 0 0; text-align:right;}
        .bggray{ background:#f9f9f9}


        .pages a,
        .pages span {
            display: inline-block;
            padding: 2px 5px;
            margin: 0 1px;
            border: 1px solid #f0f0f0;
            -webkit-border-radius: 3px;
            -moz-border-radius: 3px;
            border-radius: 3px;
        }

        .pages a,
        .pages li {
            display: inline-block;
            list-style: none;
            text-decoration: none;
            color: #58A0D3;
        }

        .pages a.first,
        .pages a.prev,
        .pages a.next,
        .pages a.end {
            margin: 0;
        }

        .pages a:hover {
            border-color: #50A8E6;
        }

        .pages span.current {
            background: #50A8E6;
            color: #FFF;
            font-weight: 700;
            border-color: #50A8E6;
        }


    </style>
</head>
<body>
<include file="Left/top" />
<!--main_top-->
<table width="99%" border="0" cellspacing="0" cellpadding="0" id="searchmain">

    <tr>
        <td align="left" valign="top">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" id="search">
                <tr>
                    <td width="90%" align="left" valign="middle">
                       <span>渠道
                           <if condition="$power eq 0">
                                <select class="channel">
                                      <option value="">请选择</option>
                                            <foreach name="arrd" item="vo">
                                                <option value="<?=$vo['channel_number']?>" <?php if($nowchannel==$vo['channel_number']){ echo "selected"; }?>><?=$vo['channel_name']?></option>
                                            </foreach>
                                        <option value="">全部</option>
                                </select>
                          <else/>
                               (<a style="color:red"  class="xchannel"  channeiname="{$channel['channel_number']}" ><?=$channel['channel_name']?></a>)
                          </if>注册总人数
                       </span>

                        <span><?=$num?>人</span>

                        <span>时间
                            <if condition="$power eq 0">
                                <input type="date" class="nosearch" value="{$search}">
                            <else/>
                                <select class="ptsearch">
                                    <foreach name="parent" item="v">
                                    <option value="<?=$v?>" <?php if($search==$v){ echo "selected"; }?>><?=$v?>
                                    </option>
                                </foreach>
                                </select>
                            </if>
                       </span>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td align="left" valign="top">

            <table width="100%" border="0" cellspacing="0" cellpadding="0" id="main-tab">
                <tr>
                    <th align="center" valign="middle" class="borderright">编号</th>
                    <th align="center" valign="middle" class="borderright">性别</th>
                    <th align="center" valign="middle" class="borderright">手机号</th>
                    <th align="center" valign="middle" class="borderright">身份证</th>
                    <th align="center" valign="middle" class="borderright">注册时间</th>
                </tr>
                <foreach name="data" item="v" key="k">
                    <tr onMouseOut="this.style.backgroundColor='#ffffff'" onMouseOver="this.style.backgroundColor='#edf5ff'">
                        <?php $p = $_POST['p'] ? $_POST['p'] : 1; ?>
                        <td align="center" valign="middle" class="borderright borderbottom"><?php echo ($p-1)*10 + $k + 1; ?></td>
                        <td align="center" valign="middle" class="borderright borderbottom">{$v['gender']}</td>
                        <td align="center" valign="middle" class="borderright borderbottom">{$v['mobile']}</td>
                        <td align="center" valign="middle" class="borderright borderbottom">{$v['card_num']}</td>
                        <td align="center" valign="middle" class="borderright borderbottom"><?=date('Y-m-d H:i:s',$v['add_time'])?></td>
                    </tr>
                </foreach>
            </table></td>
    </tr>
    <tr>
        <td align="left" valign="top" class="fenye"><?=$num?> 条数据&nbsp;&nbsp;
            <a href="javascript:void (0)" p="1" search="{$search}" onclick="page(this);">首页</a>&nbsp;
            &nbsp;
            <a href="javascript:void (0)"  p="<?php echo max(1,$p-1); ?>" search="{$search}" onclick="page(this);">上一页</a>&nbsp;&nbsp;
            <input type="number" name="" id="go" style="width:60px;text-align: center;" value="{$p}"><button style="margin-left:10px;font-size:10px;" onclick="go()">GO</button>
            <a href="javascript:void (0)" p="<?php echo min($page_num,$p+1); ?>" search="{$search}"onclick="page(this);">下一页</a>&nbsp;
            &nbsp;<a href="javascript:void (0)" p="{$page_num}" search="{$search}" onclick="page(this);">尾页</a>
        </td>
    </tr>

</table>
    <form id="form" action="{:U('channeluser')}" method="post">
        <input type="hidden" name="search" id="time" value="{$search}" />
        <input type="hidden" name="channel" id="chan" value="{$channel}" />
        <input type="hidden" name="p" id="pp" value="{$p}">
    </form>
<!-- <div class="pages" style="float:right;margin:20px 20px 0 0">
    {$pages}
</div> -->
</body>
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
    $('.channel').change(function(){
        var search=$('.nosearch').val();
        var channel=$(this).val();
        $('#time').val(search);
        $("#pp").val(1);
        $('#chan').val(channel);
        $('#form').submit();
    })
    function go(){
        var p=$("#go").val();
          var search=$('.nosearch').val();//获取查询时间
          if (isNaN(parseFloat(p)) || parseFloat(p) <= 0){
            p = 1;
          } 
          $('#pp').val(p);//获取页数
          $('#searchtime').val(search);
          var channel=$('.channel option:selected') .val();
           $('#chan').val(channel);
          // console.log($('#searchtime').val());
          $('#form').submit();
    }
     function page(e)
      {
          var p=$(e).attr('p');
          var search=$(e).attr('search')//获取查询时间
          $('#pp').val(p);//获取页数
          $('#searchtime').val(search);
          var channel=$('.channel option:selected') .val();
           $('#chan').val(channel);
          // console.log($('#searchtime').val());
          $('#form').submit();

      }
    //总管理员选择日期
    $('.nosearch').change(function(){
        var search=$(this).val();
        var channel=$('.channel option:selected') .val();
        $('#time').val(search);
        $('#chan').val(channel);
        $('#form').submit();
    })

    // 普通管理员选择日期
    $('.ptsearch').change(function(){
        var search=$(this).val();
        var channel=$('.xchannel') .attr('channeiname');
        $('#time').val(search);
        $('#chan').val(channel);
        $('#form').submit();
    })
</script>
</html>
